#ifndef _CHESS_PIECES_H_
#define _CHESS_PIECES_H_

#include "Board.h"
#include <string>
#include <map>
#include <vector>

using namespace std;

class Lcd;

class Piece
{
public:
    Piece(PieceType type, int row, int col, bool isRed);
    virtual ~Piece() = default;
    
    // 纯虚函数，每种棋子实现自己的移动规则
    virtual bool is_valid_move(int to_row, int to_col, PieceType board[9][10]) = 0;
    
    PieceType get_type() const { return type; }
    pair<int, int> get_position() const { return position; }
    bool get_is_red() const { return isRed; }
    
    void set_position(int row, int col) { position = make_pair(row, col); }
    
protected:
    PieceType type;
    pair<int, int> position; // (row, col)
    bool isRed;
};

#endif